import type { baseURL, proxy } from './proxy.type.ts'

// Http request
const proBaseUrl: baseURL = {
  TOTAL_URL: 'http://jsonplaceholder.typicode.com',
  ICON_DOWNLOAD: '/iconify',
}
// Vite proxy
const proProxy: proxy = {
  '/proxy': {
    target: 'http://jsonplaceholder.typicode.com',
    changeOrigin: false, // remember to configure the ngnix proxy, when this is false
    rewrite: (path: string) => path.replace(/\/proxy/, ''),
  },
  '/iconify': {
    target: 'https://api.iconify.design',
    changeOrigin: true,
    rewrite: (path: string) => path.replace(/\/iconify/, ''),
  },
}

export default {
  proxy: proProxy,
  baseUrl: proBaseUrl,
}
